package com.pinusmusic.service;

import com.pinusmusic.domain.*;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;

public interface MusicListService {
    /**
     * 创建歌单
     * @param addMusicList
     */
    void addMusicList(MusicList addMusicList);

    /**
     * 删除歌单以及其下面的歌曲(music_musicList表中)
     * @param mlid
     */
    void deleteMusicListAndMusicByMlid(int mlid);

    /**
     * 更新歌单
     * @param updateMusicList
     */
    boolean updateMusicList(MusicList updateMusicList);

    /**
     * 根据id查询歌单
     * @param mlid
     * @return
     */
    MusicList findMusicListByMlid(int mlid);

    PageBean<MusicList> findMusicListByPage(int currentPage, int rows);

    /**
     * 批量删除
     * @param mlids
     */
    void deleteMoreMusicList(String[] mlids);

    /**
     * 添加歌曲
     * @param mlid
     * @param mid
     */
    void addMusic(int mlid, int mid);

    List<Integer> findMusicByMlid(int mlid);

    /**
     * 批量添加歌曲到歌单
     * @param mids
     * @param mlid
     */
    void addMoreMusicToList(String[] mids, Integer mlid);

    /**
     * 移除歌单中的歌曲
     * @param mlid
     * @param mid
     */
    void remMusic(Integer mlid, int mid);

    void remMoreMusic(String[] mids, Integer mlid);

    MusicList getAddMusicList(HttpServletRequest request) throws IOException;

    ResultInfo getUpdateMusicList(HttpServletRequest request) throws IOException;

    //通过用户id查询该用户的歌单数量
    int getCountByUid(int uid);

    PageBean<MusicList> findMusicListsByName(int currentPage, int rows, String name);

    //2.0
    MusicList findMusiclistAndCreatorByMlid(int mlid);
    List<MusicList> findCreationlistByUid(int uid);
    List<MusicList> findCollectedlistByUid(int uid);
    void cancelCollectByMlid(int mlid,int uid);

    boolean createListAndAdd(String musiclistname, Integer uid,int mid);

    void collectByMlid(int mlid, int uid);
    //lwj
}
